import request from '@/utils/request'

// 查询文章列表
export function addArticle(data) {
  return request({
    url: '/content/article',
    method: 'post',
    data: data
  })
}

// 查询文章列表
export function listArticle(query) {
  return request({
    url: '/admin/article/list',
    method: 'get',
    params: query
  })
}

// 置顶状态改变
export function changeIsTop(articleId,isTop) {
  const data = {
    articleId,
    isTop
  }
  return request({
    url: '/admin/article/changeIsTop',
    method: 'put',
    params: data
  })
}

// 删除文章
export function delArticle(id) {
  return request({
    url: '/admin/article/deleteArticle/' + id,
    method: 'delete'
  })
}

// 查询分类详细
export function getArticle(id) {
  return request({
    url: '/content/article/' + id,
    method: 'get'
  })
}

// 审核帖子
export function verifyArticle(articleId,status) {
  const data = {
    articleId,
    status
  }
  return request({
    url: '/admin/article/verifyArticle',
    method: 'put',
    params: data
  })
}
